package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.WaybillDtl;
import com.xmtlxx.tms.domain.bo.WaybillDtlBo;
import com.xmtlxx.tms.domain.vo.WaybillDtlVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 运单明细Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface WaybillDtlMapper extends BaseMapperPlus<WaybillDtlMapper, WaybillDtl, WaybillDtlVo> {
    /**
     * 根据条件分页查询运单明细
     *
     * @param waybillDtl 运单明细
     * @return Page WaybillDtl
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "w.create_by"),
//        @DataColumn(key = "deptName", value = "w.dept_id"),
//        @DataColumn(key = "userName", value = "w.create_by")
//    })
    Page<WaybillDtlVo> selectPageWaybillDtlList(@Param("page") Page<WaybillDtl> page,@Param("waybillDtl") WaybillDtlBo waybillDtl);

    /**
     * 查询运单明细列表
     *
     * @param waybillDtl 运单明细
     * @return 运单明细集合
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "w.create_by"),
//        @DataColumn(key = "deptName", value = "w.dept_id"),
//        @DataColumn(key = "userName", value = "w.create_by")
//    })
    List<WaybillDtlVo> selectWaybillDtlList(@Param("waybillDtl") WaybillDtlBo waybillDtl);

    List<WaybillDtlVo> selectWaybillDtls(String waybillId);

    WaybillDtlVo selectWaybillDtlVoByID(String id);

    List<WaybillDtlVo> queryWaybillVos(@Param("ids") List<String> ids,@Param("waybillId") String waybillId);

    Boolean deleteVoById(String id);

    List<WaybillDtl> selectWaybillDtlsByWid(@Param("waybillDtl") WaybillDtlBo waybillDtl);

    int updateWaybillDtl(@Param("waybillDtl") WaybillDtl waybillDtl);

    int updateWaybillDtlBatchById(@Param("list") List<WaybillDtl> waybillDtl);

    void removeWaybillDtlBatch(@Param("list") List<WaybillDtl> waybillDtl);
}
